Strict

Import agfx

Class TLine Extends TPrimitive
	
	Field type:Int = -1
	
	
	Method New()
		Super.New(PRIMITIVE_TYPE_LINE)
	End Method
	
	Method Create:Void(A:TVector2,B:TVector2)
		Self.points.Add(A)
		Self.points.Add(B)
		Self.Update()
	End Method
	
	Method Draw:Void()
		Local p1:TVector2
		Local p2:TVector2
		p1 = Self.points.Get(0)
		p2 = Self.points.Get(1)
		DrawLine(p1.x,p1.y,p2.x,p2.y)
	End Method
	
	Method Update:Void(recalc_center:Bool=True,recalc_bbox:Bool=True,recalc_edge:Bool=True)
		If recalc_edge Then Self.CalcEdges()
		If recalc_center Then Self.CalcCenter()
		If recalc_bbox Then Self.CalcBoundingBox()
	End Method
	
End Class